$(function () {
	var hero, heroPrice;
	$.get("data/hero.json", function (res) {
		hero = res.data;
		if (res.code == 200) {
			var list = "";
			for (item of hero) {
				list += item["id"]
			}
			$.get("data/hero_price.json", function (res) {
				heroPrice = res.data;
				if (res.code == 200) {
					var lis = "";
					for (item of hero) {
						$.extend(item, heroPrice[item["id"]]);
						lis += `
								<li>
								<a href='###' class='img'><img src='${item["img"]}' alt=''><span class='mask'></span><span class='name'>${item["name"]}</span><span class='coin'>${item["coin"]}</span><span class='diamond'>${item["diamond"]}</span></a>
								<a href='###' class='buy'>购买</a>
								</li>
								`;
					}
					ul = "<ul>" + lis + "</ul>";
					$(".con").html(ul);
				}
			})
		}
	})
});
